<?php
/**
 * The template for displaying Search Results pages.
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */

get_header(); ?>

		<section id="primary">
			<div id="content" role="main">
  				<div class="container">
                	<?php get_sidebar(); ?>
                  		<div id="main">
			<?php if ( have_posts() ) : ?>

				<header class="page-header">
					<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
				</header>

				<!--?php twentyeleven_content_nav( 'nav-above' ); ?-->
				
				<?php /* Start the Loop */ ?>
				<?php while ( have_posts() ) : the_post(); ?>
				<div class="entry" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                    <div class="entry-header">
                        <?php if ( is_sticky() ) : ?>
                            <hgroup>
                                <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
                                <!--h3 class="entry-format"><!--?php _e( 'Featured', 'twentyeleven' ); ?></h3-->
                            </hgroup>
                        <?php else : ?>
                        <h2 class="title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
                        <?php endif; ?>
            
                        <?php if ( 'post' == get_post_type() ) : ?>
                            <p class="meta"><?php the_author_posts_link(); ?>  发布于 <strong> <?php if (function_exists('time_since')) {
    echo time_since(abs(strtotime($post->post_date_gmt . "GMT")), time()) ;
    } else {
    the_time('F jS, Y');
    } ?></strong>
     </p>
                        <?php endif; ?>
                            <a href="<?php the_permalink(); ?>" class="button">继续阅读</a>
                    </div><!-- end .entry-header -->                    <div class="entry-content">
                        <a href="#"><img src="<?php echo catch_that_image() ?>"  width="200" height="140" alt="" class="entry-image" /></a>
                        <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
                        <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
                        <hr>
                        <ul class="entry-links">
                            <li><a href="#">发送给朋友</a> <span class="separator">|</span></li>
                            <li><a href="#">分享</a> <span class="separator">|</span></li>
                            <?php if ( comments_open() && ! post_password_required() ) : ?>
                            <li><a href="<?php comments_link(); ?> "><?php comments_number('暂无评论', '1 条评论', '% 条评论'); ?></a></li>
                            <?php endif; ?>
                    </ul>
                    </div><!-- end .entry-content -->
                    </div>
				<?php endwhile; ?>

				<!--?php twentyeleven_content_nav( 'nav-below' ); ?-->

			<?php else : ?>

				<article id="post-0" class="post no-results not-found">
					<header class="entry-header">
						<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
					</header><!-- .entry-header -->

					<div class="entry-content">
						<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyeleven' ); ?></p>
						<?php get_search_form(); ?>
					</div><!-- .entry-content -->
				</article><!-- #post-0 -->

			<?php endif; ?>
            		</div><!-- #content -->
				</div><!-- #content -->
                <div class="clear"></div>
			</div><!-- #content -->
		</section><!-- #primary -->


<?php get_footer(); ?>